/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.ControlInternalFrame;
import GUI.CustomerManager.JIF_CustomerManager;
import GUI.Index.JIF_Parameter;
import GUI.Index.JIF_SavingTypeManager;
import GUI.SavingBookManager.JIF_SavingBookManager;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JDesktopPane;
/**
 *
 * @author Nguyen Phi Hung
 */
public class JInterFrame_ControlManager extends javax.swing.JInternalFrame {
    
    private JDesktopPane desktop;
    /**
     * Creates new form JInterFrame_ControlManager
     */
    public JInterFrame_ControlManager() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        btn_QuanLyKhachHang = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();

        setTitle("Nghiệp vụ quản lý");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultCloseOperation}"), this, org.jdesktop.beansbinding.BeanProperty.create("closable"));
        bindingGroup.addBinding(binding);

        btn_QuanLyKhachHang.setText("Quản lý Khách hàng");
        btn_QuanLyKhachHang.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        btn_QuanLyKhachHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_QuanLyKhachHangActionPerformed(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/resource/btn_savingbookmanager.png"))); // NOI18N
        jButton2.setText("Quản lý sổ tiết kiệm");
        jButton2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Quản lý tham số");
        jButton3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("Quản lý loại tiết kiệm");
        jButton4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(btn_QuanLyKhachHang, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                    .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btn_QuanLyKhachHang, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(104, Short.MAX_VALUE))
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        if(getDesktop().getComponentCount()!=0)
            getDesktop().getComponent(0).setVisible(false);
        getDesktop().removeAll();
        JIF_SavingBookManager saving = null;
        try {
            saving = new JIF_SavingBookManager();
        } catch (Exception ex) {
            Logger.getLogger(JInterFrame_ControlManager.class.getName()).log(Level.SEVERE, null, ex);
        }
        saving.setVisible(true);
        getDesktop().add(saving);        
    }//GEN-LAST:event_jButton2ActionPerformed

    private void btn_QuanLyKhachHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_QuanLyKhachHangActionPerformed
        // TODO add your handling code here:
        if(getDesktop().getComponentCount() != 0)
            getDesktop().getComponent(0).setVisible(false);
        getDesktop().removeAll();
        JIF_CustomerManager frame = null;
        try {
            frame = new JIF_CustomerManager();
        } catch (Exception ex) {
            Logger.getLogger(JInterFrame_ControlManager.class.getName()).log(Level.SEVERE, null, ex);
        }
        frame.setVisible(true);
        getDesktop().add(frame);
    }//GEN-LAST:event_btn_QuanLyKhachHangActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        if(getDesktop().getComponentCount() != 0)
            getDesktop().getComponent(0).setVisible(false);
        getDesktop().removeAll();
        JIF_SavingTypeManager frame = null;
        try {
            frame = new JIF_SavingTypeManager();
        } catch (Exception ex) {
            Logger.getLogger(JInterFrame_ControlManager.class.getName()).log(Level.SEVERE, null, ex);
        }
        frame.setVisible(true);
        getDesktop().add(frame);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        if(getDesktop().getComponentCount() != 0)
            getDesktop().getComponent(0).setVisible(false);
        getDesktop().removeAll();
        JIF_Parameter frame = null;
        try {
            frame = new JIF_Parameter();
        } catch (Exception ex) {
            Logger.getLogger(JInterFrame_ControlManager.class.getName()).log(Level.SEVERE, null, ex);
        }
        frame.setVisible(true);
        getDesktop().add(frame);
    }//GEN-LAST:event_jButton3ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_QuanLyKhachHang;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the desktop
     */
    public JDesktopPane getDesktop() {
        return desktop;
    }

    /**
     * @param desktop the desktop to set
     */
    public void setDesktop(JDesktopPane desktop) {
        this.desktop = desktop;
    }
}
